Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Added Payment Gateway Stripe #106

Merged
merged 3 commits into from
Dec 28, 2023

Conversation

Priyansh61
Copy link
Collaborator

Overview

  1. This PR adds payment gateway for the REST API
  2. This PR does the following: We will be using the Stripe payment gateway to make payments within our application and the gateway has been added.

We have also created a webhook to check the status of the payment iniitiated by the user and on that basis only we will be updating the status of the ticket.

This still needs to be tested with the TESTING CREDENTIALS.

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
  • The PR is made from a branch that's not called "main/master".

Proof that changes are correct

PR Pointers

  • If you need a review or an answer to a question, and don't have permissions to assign people, leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL".
  • Never force push. If you do, your PR will be closed.

Copy link

netlify bot commented Dec 10, 2023

Deploy Preview for merch-site canceled.

Name Link
🔨 Latest commit d08f5d3
🔍 Latest deploy log https://app.netlify.com/sites/merch-site/deploys/658d7360d3e6f20008cae5ca

Copy link
Collaborator

@arminpatel arminpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also could you add a default choice for status in ticket model? Everything else looks great, tested webhook endpoint locally. Could not test payment-intent endpoint but should work correctly.


try :
event = stripe.Webhook.construct_event(
payload, sig_header, settings.STRIPE_WEBHOOK_SECRET
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no variable named STRIPE_WEBHOOK_SECRET in settings

def post(self, request, *args, **kwargs):
amount = request.data.get('amount')
print(request.data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this?

@ChaudharyRaman ChaudharyRaman merged commit 8f2cec2 into bsoc-bitbyte:main Dec 28, 2023
4 of 6 checks passed
Copy link

@aryan1113 aryan1113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a super().save function in backend/tickets/models.py, to have a full clean
something along the lines of

def save(self, *args, **kwargs):
    self.full_clean()
    super().save(*args, **kwargs)

Full clean cleans each individual field, and will validate all fields on the model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants